import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:pornhub_app/utils/color.dart';
import 'package:pornhub_app/utils/extension.dart';
import 'package:pornhub_app/views/engagement/views/engagement_vertical_list_page.dart';

class EngagementCityPage extends StatefulWidget {
  final String classifyId;
  final String cityName;
  final int meetType;

  const EngagementCityPage(
      {super.key,
      required this.classifyId,
      required this.cityName,
      required this.meetType});

  @override
  State createState() => _EngagementCityPageState();
}

class _EngagementCityPageState extends State<EngagementCityPage> {
  @override
  void initState() {
    super.initState();
  }

  AppBar _buildAppBar(BuildContext context) {
    return AppBar(
      leading: Container(
        padding: EdgeInsets.all(20.w),
        child: Image.asset(
          "assets/images/icons/base_ic_back_grey.png",
          width: 9.w,
          height: 16.w,
        ),
      ).onOpaqueTap(() {
        onBackClick(context);
      }),
      title: Text(widget.cityName,
          textAlign: TextAlign.center,
          style: TextStyle(
            color: COLOR.hexColor("#333333"),
            fontSize: 16.sp,
            fontWeight: FontWeight.w500,
          )),
      centerTitle: true,
      bottom: PreferredSize(
        preferredSize: Size.fromHeight(1.w),
        child: Container(
          height: 1.w,
          color: COLOR.hexColor("#F0F0F0"),
        ),
      ),
    );
  }

  void onBackClick(BuildContext context) {
    Navigator.pop(context);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: _buildAppBar(context),
      body: EngagementVerticalListPage(
        dataType: 1,
        meetType: widget.meetType,
        classifyId: widget.classifyId,
        cityName: widget.cityName,
      ).paddingTop(14.w),
    );
  }
}
